package org.cosmact.designer.vxml.gefeditor.layer;

import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.FreeformLayer;
import org.eclipse.draw2d.Graphics;

/**
 * See <a href=
 * "http://www.ibm.com/developerworks/cn/opensource/os-ecl-gef/part3/index.html"
 * >Custom layer</a>
 * 
 *@author YeXiaowei 234aini@gmail.com
 * 
 */
public class BackgroundLayer extends FreeformLayer {

	public static final String BACKGROUND_LAYER = "Background Layer";

	public BackgroundLayer() {
		setOpaque(true);
	}

	@Override
	protected void paintFigure(Graphics graphics) {
		if (isOpaque()) {
			graphics.setForegroundColor(ColorConstants.white);
			graphics.setBackgroundColor(ColorConstants.lightBlue);
			graphics.fillGradient(getBounds(), true);
		}
	}

}
